]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
remoteSearch: Allow search providers not to auto-start
authorBastien Nocera <hadess@hadess.net>
Thu, 24 Aug 2017 11:06:45 +0000 (13:06 +0200)
committerBastien Nocera <hadess@hadess.net>
Thu, 14 Sep 2017 15:03:14 +0000 (17:03 +0200)
This would be used by search providers which only operate on data in the
running instance, such as the terminal's search provider which finds the
shell in the tab matching the search text.

https://bugzilla.gnome.org/show_bug.cgi?id=785380

js/ui/remoteSearch.js

index 24897a59928fe7813bc34061a770e76e0b02fe6c..a7be9265d717910c82e69721b75085216c89e781 100644 (file)
@@ -117,6 +117,13 @@ function loadRemoteSearchProviders(searchSettings, callback) {
                 // ignore error
             }
 
+            remoteProvider.autoStart = true;
+            try {
+                remoteProvider.autoStart = keyfile.get_boolean(group, 'AutoStart');
+            } catch(e) {
+                // ignore error
+            }
+
             objectPaths[objectPath] = remoteProvider;
             loadedProviders.push(remoteProvider);
         } catch(e) {
@@ -188,13 +195,18 @@ var RemoteSearchProvider = new Lang.Class({
         if (!proxyInfo)
             proxyInfo = SearchProviderProxyInfo;
 
+        let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;
+        if (remoteProvider.autoStart)
+            g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION;
+        else
+            g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
+
         this.proxy = new Gio.DBusProxy({ g_bus_type: Gio.BusType.SESSION,
                                          g_name: dbusName,
                                          g_object_path: dbusPath,
                                          g_interface_info: proxyInfo,
                                          g_interface_name: proxyInfo.name,
-                                         g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION |
-                                                   Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
+                                         g_flags });
         this.proxy.init_async(GLib.PRIORITY_DEFAULT, null, null);
 
         this.appInfo = appInfo;